<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="/WEB-INF/tld/application.tld" prefix="app" %>


	<logic:present name="listServicos" scope="request">
		<table>
			<tr>
				<td valign="top" align="right">
				
					<table class="tbDadosConsulta" style="width:600px">
						<tr>
							<th width="30"></th>
							<th>Descrição</th>
							<th>Qtde</th>
							<th>Valor</th>
							<th>Total</th>
							<th width="30"></th>
						</tr>
						<logic-el:iterate id="bean" name="listServicos" scope="request" indexId="i">
							<tr class="linha${i%2}">
								<td style="text-align:center">${i+1}</td>
								<td>${bean.descricao}</td>
								<td style="text-align:center">${bean.qtde}</td>
								<td style="text-align:right">
									<bean:write name="bean" property="valorUnitario" format="###,##0.00" locale="defaultLocale"/>
								</td>
								<td style="text-align:right">
									<bean:write name="bean" property="valorTotal" format="###,##0.00" locale="defaultLocale"/>
								</td>
								<td align="center">
									<logic:empty name="bean" property="curso">
										<a href="javascript:excluirServico(${i})" >
											<img alt="Excluir" src="_images/remove.png">
										</a>
									</logic:empty>
								</td>
							</tr>
						</logic-el:iterate>
						<tr>
							<td style="text-align:center;vertical-align: middle">
								<a href="javascript:incluirServico()"><img src="_images/add.png" border="0"></a>
							</td>
						</tr>
					</table>
				
				</td>
				<td valign="top" align="right" style="width:100%">
				
					<table style="width:100%" class="breadory">
						<tr>
							<td style="text-align:right;font-size: 18px; width: 100px">Sub-Total</td>
							<td style="text-align:right;font-size: 24px; width: 120px"><b>R$ 
								<bean:write name="subTotal" format="###,##0.00" locale="defaultLocale"/>
							</b></td>
							<td></td>
						</tr>
						<logic-el:present name="totalPago" scope="request">
							<tr>
								<td style="text-align:right;font-size: 18px">Pago:</td>
								<td style="text-align:right;font-size: 24px;color:#2A4380"><b>
									- <bean:write name="totalPago" format="###,##0.00" locale="defaultLocale"/>
								</b></td>
								<td></td>
							</tr>
						</logic-el:present>
						
						<logic-el:present name="acrescimoServicos">
							<tr>
								<td style="text-align:right;font-size: 18px"></td>
								<td style="text-align:right;font-size: 18px;color:#9D2E2C"><b> 
									+ ${acrescimoServicos} %
								</b></td>
								<td></td>
							</tr>
						</logic-el:present>
						<tr>
							<td style="text-align:right;font-size: 18px">Total: </td>
							<td style="text-align:right;font-size: 24px"><b>R$ 
								<bean:write name="total" format="###,##0.00" locale="defaultLocale"/>
							</b></td>
							<td></td>
						</tr>
						<input type="hidden" id="valorPagoTemp" value="<bean:write name="total" format="###,##0.00" locale="defaultLocale"/>"/>
					</table>				
				
				</td>
			</tr>
		</table>
		<logic:empty name="listServicos" scope="request">
			Nenhum serviço adicionado.
		</logic:empty>
	</logic:present>